package com.itheima.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.domain.ProductAttributeValue;
import com.itheima.mapper.ProductAttributeValueMapper;
import com.itheima.service.IProductAttributeValueService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 * 存储产品参数信息的表 服务实现类
 * </p>
 *
 * @author fukeke
 * @since 2022-11-11
 */
@DubboService
public class ProductAttributeValueServiceImpl extends ServiceImpl<ProductAttributeValueMapper, ProductAttributeValue> implements IProductAttributeValueService {
    @Autowired
    ProductAttributeValueMapper productAttributeValueMapper;

    @Override
    public List<ProductAttributeValue> selectByProductId(Long productId) {
        LambdaQueryWrapper<ProductAttributeValue> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ProductAttributeValue::getProductId,productId);

        return productAttributeValueMapper.selectList(queryWrapper);
    }

    @Override
    public void createPmsProductAttributeValue(ProductAttributeValue pmsProductAttributeValue) {
        productAttributeValueMapper.insert(pmsProductAttributeValue);
    }
}
